/* 
 * File:   ListaLigada.cpp
 * Author: User007
 * 
 * Created on August 22, 2011, 2:59 PM
 */

#include "ListaLigada.h"
#include "Label.h"
#include <stdlib.h>
#include <stdio.h>
#include "Label_Struct.h"

ListaLigada::ListaLigada() {
    size = 0;
}

ListaLigada::ListaLigada(const ListaLigada& orig) {
}

ListaLigada::~ListaLigada() {
}

void ListaLigada::add(label_struct label) {
    label_struct *listaAux = (label_struct*) malloc((size) * sizeof (label_struct));

    for (int i = 0; i < size; i++) {
        listaAux[i] = l[i];
    }

    l = (label_struct*) malloc((size + 1) * sizeof (label_struct));

    for (int i = 0; i < size; i++) {
        l[i] = listaAux[i];
    }
    l[size] = label;
    size = size + 1;
}

label_struct ListaLigada::get(int i) {
    return l[i];
}


